package bigraph.part.tree;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;

import bigraph.model.*;

public class AppTreeEditPartFactory implements EditPartFactory {

	@Override
	public EditPart createEditPart(EditPart context, Object model) {
		EditPart part = null;
		if (model instanceof Canvas)
			part = new CanvasTreeEditPart();
		else if (model instanceof Root)
	        part = new RootTreeEditPart();
		else if (model instanceof Site)
	        part = new SiteTreeEditPart();
		else if (model instanceof Place)
	        part = new PlaceTreeEditPart();
		if (part != null)
			part.setModel(model);
		return part;
	}


}
